package Strategy;

/**
 * @author liuyang
 * @since 2022/6/24 18:22
 */

public class Test {
    public static void main(String[] args) {
        String money = "1220.5";
        String[] params1 = {"rebate", "8"};
        Strategy strategy = GetCashFactory.createCharge(params1);
        System.out.println(strategy.payMoney(money));
        String[] params2 = {"return", "300", "30"};
        Strategy strategy1 = GetCashFactory.createCharge(params2);
        System.out.println(strategy1.payMoney(money));

        CashStrategy cashContext = new CashStrategy(new String[]{""});
        System.out.println(cashContext.acceptCash(money));
        CashStrategy cashContext1 = new CashStrategy(params1);
        System.out.println(cashContext1.acceptCash(money));
        CashStrategy cashContext2 = new CashStrategy(params2);
        System.out.println(cashContext2.acceptCash(money));
    }
}
